const user = "root";
const password = "CoeServer123!@#"

const conn = new Mongo('localhost:27017');
const admin = conn.getDB('admin');
admin.createUser({user:user,pwd:password,roles:["root"]}) 
admin.auth(user, password);

const ig = conn.getDB('ig');
ig.c_account.createIndex({"iggid":1}, {unique: true});
ig.c_activity.createIndex({"id":1}, {unique: true});
ig.c_alliance_flag.createIndex({"guildId":1}, {unique: true});
ig.c_alliance_kill.createIndex({"guildId":1}, {unique: true});
ig.c_alliance_power.createIndex({"guildId":1}, {unique: true});
ig.c_chat.createIndex({"gameNode":1}, {unique: true});
ig.c_chat_guild.createIndex({"gameNode":1}, {unique: true});
ig.c_combat_first.createIndex({"rid":1}, {unique: true});
ig.c_email_content.createIndex({"contentId":1}, {unique: true});
ig.c_expedition.createIndex({"rid":1}, {unique: true});
ig.c_expeditionShop.createIndex({"id":1}, {unique: true});
ig.c_fight_horn.createIndex({"rid":1}, {unique: true});
ig.c_fight_horn_alliance.createIndex({"guildId":1}, {unique: true});
ig.c_guild.createIndex({"guildId":1}, {unique: true});
ig.c_guild_abbname.createIndex({"abbname":1}, {unique: true});
ig.c_guild_building.createIndex({"guildId":1}, {unique: true});
ig.c_guild_gift.createIndex({"guildId":1}, {unique: true});
ig.c_guild_message_board.createIndex({"guildId":1}, {unique: true});
ig.c_guild_name.createIndex({"name":1}, {unique: true});
ig.c_guild_resource_help.createIndex({"guildId":1}, {unique: true});
ig.c_guild_role_build.createIndex({"guildId":1}, {unique: true});
ig.c_guild_role_donate.createIndex({"guildId":1}, {unique: true});
ig.c_guild_role_help.createIndex({"guildId":1}, {unique: true});
ig.c_guild_role_kill.createIndex({"guildId":1}, {unique: true});
ig.c_guild_role_power.createIndex({"guildId":1}, {unique: true});
ig.c_guild_shop.createIndex({"guildId":1}, {unique: true});
ig.c_hallActivity.createIndex({"id":1}, {unique: true});
ig.c_hell_activity_rank.createIndex({"id":1}, {unique: true});
ig.c_holy_land.createIndex({"id":1}, {unique: true});
ig.c_kill_type.createIndex({"id":1}, {unique: true});
ig.c_kill_type_history.createIndex({"id":1}, {unique: true});
ig.c_king.createIndex({"id":1}, {unique: true});
ig.c_map_object.createIndex({"id":1}, {unique: true});
ig.c_monument.createIndex({"id":1}, {unique: true});
ig.c_pkid.createIndex({"id":1}, {unique: true});
ig.c_recharge.createIndex({"id":1}, {unique: true});
ig.c_recommend.createIndex({"node":1}, {unique: true});
ig.c_refresh.createIndex({"id":1}, {unique: true});
ig.c_reserve.createIndex({"rid":1}, {unique: true});
ig.c_rise_up.createIndex({"rid":1}, {unique: true});
ig.c_role_collect_res.createIndex({"rid":1}, {unique: true});
ig.c_role_kill.createIndex({"rid":1}, {unique: true});
ig.c_role_name.createIndex({"name":1}, {unique: true});
ig.c_role_power.createIndex({"rid":1}, {unique: true});
ig.c_system.createIndex({"id":1}, {unique: true});
ig.c_systemmail.createIndex({"id":1}, {unique: true});
ig.c_townhall.createIndex({"rid":1}, {unique: true});
ig.c_tribe_king.createIndex({"guildId":1}, {unique: true});
ig.d_army.createIndex({"rid":1}, {unique: true});
ig.d_building.createIndex({"rid":1}, {unique: true});
ig.d_chat.createIndex({"rid":1}, {unique: true});
ig.d_email.createIndex({"rid":1}, {unique: true});
ig.d_hero.createIndex({"rid":1}, {unique: true});
ig.d_item.createIndex({"rid":1}, {unique: true});
ig.d_role.createIndex({"rid":1}, {unique: true});
ig.d_scouts.createIndex({"rid":1}, {unique: true});
ig.d_task.createIndex({"rid":1}, {unique: true});
ig.d_transport.createIndex({"rid":1}, {unique: true});
ig.d_user.createIndex({"uid":1}, {unique: true});